import axios from './axios'
import resfulParamsToUrl from './resfulParamsToUrl'
// 字典类型新增
export const dictTypeInsert = params => {
	return axios
		.post(
			resfulParamsToUrl('/sys/auth/tsysdatadicttype/insert', params),
			params,
		)
		.catch(() => {})
}
export const updateDictType = params => {
	return axios
		.post(
			resfulParamsToUrl('/sys/auth/tsysdatadicttype/update', params),
			params,
		)
		.catch(() => {})
}
// 字典类型删除
export const dictTypeDelete = params => {
	return axios
		.post(
			resfulParamsToUrl('/sys/auth/tsysdatadicttype/delete', params),
			params,
		)
		.catch(() => {})
}
// 字典类型查询
export const getDictTypeModel = params => {
	axios.prototype._loading_ = false
	return axios
		.post(
			resfulParamsToUrl('/sys/auth/tsysdatadicttype/getModel', params),
			params,
		)
		.catch(() => {})
}
// 字典类型分页查询
export const getDictTypePageList = params => {
	return axios
		.post(
			resfulParamsToUrl('/sys/auth/tsysdatadicttype/pageList', params),
			params,
		)
		.catch(() => {})
}
// 字典分页查询
export const getDictPageList = params => {
	return axios
		.post(resfulParamsToUrl('/sys/auth/tsysdatadict/pageList', params), params)
		.catch(() => {})
}
// 字典查询
export const getDictModel = params => {
	axios.prototype._loading_ = false
	return axios
		.post(resfulParamsToUrl('/sys/auth/tsysdatadict/getModel', params), params)
		.catch(() => {})
}
// 字典查询集合
export const getDictModelList = params => {
	axios.prototype._loading_ = false
	return axios
		.post(resfulParamsToUrl('/sys/auth/tsysdatadict/getList', params), params)
		.catch(() => {})
}
// 字典新增
export const dictInset = params => {
	return axios
		.post(resfulParamsToUrl('/sys/auth/tsysdatadict/insert', params), params)
		.catch(() => {})
}
// 字典编辑
export const updateDict = params => {
	return axios
		.post(resfulParamsToUrl('/sys/auth/tsysdatadict/update', params), params)
		.catch(() => {})
}
// 字典删除
export const deleteDict = params => {
	return axios
		.post(resfulParamsToUrl('/sys/auth/tsysdatadict/delete', params), params)
		.catch(() => {})
}
//redis中获取字典项
export const getSysDataDictList = params => {
	axios.prototype._loading_ = false
	return axios
		.post(
			resfulParamsToUrl('/sys/auth/tsysdatadicttype/sysDataDictList', params),
			params,
		)
		.catch(() => {})
}
